<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: coap_io.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('coap__io_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">coap_io.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;coap_config.h&quot;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
<code>#include &quot;<a class="el" href="libcoap_8h_source.html">libcoap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__debug_8h_source.html">coap_debug.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h_source.html">mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="net_8h_source.html">net.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__io_8h_source.html">coap_io.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pdu_8h_source.html">pdu.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utlist_8h_source.html">utlist.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="resource_8h_source.html">resource.h</a>&quot;</code><br />
</div>
<p><a href="coap__io_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structin6__pktinfo.html">in6_pktinfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structin__pktinfo.html">in_pktinfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a68cc6215788f9cdd08a1ba436f3cb726" id="r_a68cc6215788f9cdd08a1ba436f3cb726"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a68cc6215788f9cdd08a1ba436f3cb726">SOL_IP</a>&#160;&#160;&#160;IPPROTO_IP</td></tr>
<tr class="separator:a68cc6215788f9cdd08a1ba436f3cb726"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32dce3380228f1a23cdc1f784263762b" id="r_a32dce3380228f1a23cdc1f784263762b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a32dce3380228f1a23cdc1f784263762b">UNUSED_PARAM</a></td></tr>
<tr class="separator:a32dce3380228f1a23cdc1f784263762b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9eebbef7851c960b14178bc27b2e083" id="r_ac9eebbef7851c960b14178bc27b2e083"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#ac9eebbef7851c960b14178bc27b2e083">iov_len_t</a>&#160;&#160;&#160;size_t</td></tr>
<tr class="separator:ac9eebbef7851c960b14178bc27b2e083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95d3fb172d041a6a70f3a5c7ae742b7e" id="r_a95d3fb172d041a6a70f3a5c7ae742b7e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a95d3fb172d041a6a70f3a5c7ae742b7e">SIN6</a>(A)&#160;&#160;&#160;((struct sockaddr_in6 *)(A))</td></tr>
<tr class="separator:a95d3fb172d041a6a70f3a5c7ae742b7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a157d58fe7840d7d7e36c40fff0825674" id="r_a157d58fe7840d7d7e36c40fff0825674"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a157d58fe7840d7d7e36c40fff0825674">coap_free_endpoint</a> (<a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *ep)</td></tr>
<tr class="separator:a157d58fe7840d7d7e36c40fff0825674"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0cc13e29656551862a46150320f9390" id="r_ae0cc13e29656551862a46150320f9390"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#ae0cc13e29656551862a46150320f9390">coap_socket_format_errno</a> (int error)</td></tr>
<tr class="separator:ae0cc13e29656551862a46150320f9390"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5022495d015538fd94dff992dddad2f2" id="r_a5022495d015538fd94dff992dddad2f2"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a5022495d015538fd94dff992dddad2f2">coap_malloc_endpoint</a> (void)</td></tr>
<tr class="separator:a5022495d015538fd94dff992dddad2f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a376568994d56368c7704b52aaab111a6" id="r_a376568994d56368c7704b52aaab111a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a376568994d56368c7704b52aaab111a6">coap_mfree_endpoint</a> (struct <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *ep)</td></tr>
<tr class="separator:a376568994d56368c7704b52aaab111a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d1deb43ee288c60730c3c8c5df8ec73" id="r_a9d1deb43ee288c60730c3c8c5df8ec73"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a9d1deb43ee288c60730c3c8c5df8ec73">coap_socket_bind_udp</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *listen_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *bound_addr)</td></tr>
<tr class="separator:a9d1deb43ee288c60730c3c8c5df8ec73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85ec542c39fda4a6a5346c7801bf0ecd" id="r_a85ec542c39fda4a6a5346c7801bf0ecd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a85ec542c39fda4a6a5346c7801bf0ecd">coap_socket_connect_tcp1</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_if, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *server, int default_port, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *remote_addr)</td></tr>
<tr class="separator:a85ec542c39fda4a6a5346c7801bf0ecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae591a90d6202a1b7f82b1aa688614520" id="r_ae591a90d6202a1b7f82b1aa688614520"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#ae591a90d6202a1b7f82b1aa688614520">coap_socket_connect_tcp2</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *remote_addr)</td></tr>
<tr class="separator:ae591a90d6202a1b7f82b1aa688614520"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c01bf1b3043f11f948e4f3aff1b7823" id="r_a1c01bf1b3043f11f948e4f3aff1b7823"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a1c01bf1b3043f11f948e4f3aff1b7823">coap_socket_bind_tcp</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *listen_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *bound_addr)</td></tr>
<tr class="separator:a1c01bf1b3043f11f948e4f3aff1b7823"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac7a863c20dfbbabaa56cddd2c4109f9" id="r_aac7a863c20dfbbabaa56cddd2c4109f9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#aac7a863c20dfbbabaa56cddd2c4109f9">coap_socket_accept_tcp</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *server, <a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *new_client, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *remote_addr)</td></tr>
<tr class="separator:aac7a863c20dfbbabaa56cddd2c4109f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1086276cc42228e6b0b1c72b4f72fa84" id="r_a1086276cc42228e6b0b1c72b4f72fa84"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a1086276cc42228e6b0b1c72b4f72fa84">coap_socket_connect_udp</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_if, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *server, int default_port, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *local_addr, <a class="el" href="structcoap__address__t.html">coap_address_t</a> *remote_addr)</td></tr>
<tr class="separator:a1086276cc42228e6b0b1c72b4f72fa84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2de382e7795c908d1a376da8c338386d" id="r_a2de382e7795c908d1a376da8c338386d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a2de382e7795c908d1a376da8c338386d">coap_socket_close</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock)</td></tr>
<tr class="separator:a2de382e7795c908d1a376da8c338386d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53d8fd138fc5bf331c2bf71d72ac4848" id="r_a53d8fd138fc5bf331c2bf71d72ac4848"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a53d8fd138fc5bf331c2bf71d72ac4848">coap_socket_write</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="separator:a53d8fd138fc5bf331c2bf71d72ac4848"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bbd598665f98a1e2f899b475f01618b" id="r_a2bbd598665f98a1e2f899b475f01618b"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a2bbd598665f98a1e2f899b475f01618b">coap_socket_read</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="separator:a2bbd598665f98a1e2f899b475f01618b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e9bc78d20872c6ea9cb8dddfcea45ad" id="r_a9e9bc78d20872c6ea9cb8dddfcea45ad"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a9e9bc78d20872c6ea9cb8dddfcea45ad">coap_network_send</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t datalen)</td></tr>
<tr class="separator:a9e9bc78d20872c6ea9cb8dddfcea45ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bc4949c9ad150282ec082c99510046b" id="r_a4bc4949c9ad150282ec082c99510046b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a4bc4949c9ad150282ec082c99510046b">coap_packet_get_memmapped</a> (<a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *packet, unsigned char **address, size_t *length)</td></tr>
<tr class="memdesc:a4bc4949c9ad150282ec082c99510046b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a packet, set msg and msg_len to an address and length of the packet's data in memory.  <br /></td></tr>
<tr class="separator:a4bc4949c9ad150282ec082c99510046b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af218007b0248f28b60cd0420d466c1a2" id="r_af218007b0248f28b60cd0420d466c1a2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#af218007b0248f28b60cd0420d466c1a2">coap_packet_set_addr</a> (<a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *packet, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *src, const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *dst)</td></tr>
<tr class="separator:af218007b0248f28b60cd0420d466c1a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b8fa856db7113a97f74c726219c4be4" id="r_a9b8fa856db7113a97f74c726219c4be4"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a9b8fa856db7113a97f74c726219c4be4">coap_network_read</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, <a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *packet)</td></tr>
<tr class="memdesc:a9b8fa856db7113a97f74c726219c4be4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function interface for reading data.  <br /></td></tr>
<tr class="separator:a9b8fa856db7113a97f74c726219c4be4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaac86ac50793f309678e4951ecf8863f" id="r_aaac86ac50793f309678e4951ecf8863f"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#aaac86ac50793f309678e4951ecf8863f">coap_write</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sockets[], unsigned int max_sockets, unsigned int *num_sockets, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="memdesc:aaac86ac50793f309678e4951ecf8863f"><td class="mdescLeft">&#160;</td><td class="mdescRight">For applications with their own message loop, send all pending retransmits and return the list of sockets with events to wait for and the next timeout The application should call coap_read, then coap_write again when any condition below is true:  <br /></td></tr>
<tr class="separator:aaac86ac50793f309678e4951ecf8863f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75a7c93e10ca7858449ba304aad4ea37" id="r_a75a7c93e10ca7858449ba304aad4ea37"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a75a7c93e10ca7858449ba304aad4ea37">coap_run_once</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, unsigned timeout_ms)</td></tr>
<tr class="separator:a75a7c93e10ca7858449ba304aad4ea37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d4397c1a2ce78e64c19fdcd25256737" id="r_a3d4397c1a2ce78e64c19fdcd25256737"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a3d4397c1a2ce78e64c19fdcd25256737">coap_socket_strerror</a> (void)</td></tr>
<tr class="separator:a3d4397c1a2ce78e64c19fdcd25256737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3728d8a61188dd4b3afd1aff807109f7" id="r_a3728d8a61188dd4b3afd1aff807109f7"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__io_8c.html#a3728d8a61188dd4b3afd1aff807109f7">coap_socket_send</a> (<a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *sock, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="separator:a3728d8a61188dd4b3afd1aff807109f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ac9eebbef7851c960b14178bc27b2e083" name="ac9eebbef7851c960b14178bc27b2e083"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9eebbef7851c960b14178bc27b2e083">&#9670;&#160;</a></span>iov_len_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define iov_len_t&#160;&#160;&#160;size_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00754">754</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a95d3fb172d041a6a70f3a5c7ae742b7e" name="a95d3fb172d041a6a70f3a5c7ae742b7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95d3fb172d041a6a70f3a5c7ae742b7e">&#9670;&#160;</a></span>SIN6</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SIN6</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">A</td><td>)</td>
          <td>&#160;&#160;&#160;((struct sockaddr_in6 *)(A))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00909">909</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a68cc6215788f9cdd08a1ba436f3cb726" name="a68cc6215788f9cdd08a1ba436f3cb726"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68cc6215788f9cdd08a1ba436f3cb726">&#9670;&#160;</a></span>SOL_IP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOL_IP&#160;&#160;&#160;IPPROTO_IP</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00726">726</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a32dce3380228f1a23cdc1f784263762b" name="a32dce3380228f1a23cdc1f784263762b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32dce3380228f1a23cdc1f784263762b">&#9670;&#160;</a></span>UNUSED_PARAM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UNUSED_PARAM</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00732">732</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a157d58fe7840d7d7e36c40fff0825674" name="a157d58fe7840d7d7e36c40fff0825674"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a157d58fe7840d7d7e36c40fff0825674">&#9670;&#160;</a></span>coap_free_endpoint()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_free_endpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__session_8c_source.html#l00901">901</a> of file <a class="el" href="coap__session_8c_source.html">coap_session.c</a>.</p>

</div>
</div>
<a id="a5022495d015538fd94dff992dddad2f2" name="a5022495d015538fd94dff992dddad2f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5022495d015538fd94dff992dddad2f2">&#9670;&#160;</a></span>coap_malloc_endpoint()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> * coap_malloc_endpoint </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00181">181</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a376568994d56368c7704b52aaab111a6" name="a376568994d56368c7704b52aaab111a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a376568994d56368c7704b52aaab111a6">&#9670;&#160;</a></span>coap_mfree_endpoint()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_mfree_endpoint </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00186">186</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a9b8fa856db7113a97f74c726219c4be4" name="a9b8fa856db7113a97f74c726219c4be4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b8fa856db7113a97f74c726219c4be4">&#9670;&#160;</a></span>coap_network_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_network_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function interface for reading data. </p>
<p>This function returns the number of bytes that have been read, or a value less than zero on error. In case of an error, <code>*packet</code> is set to NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>Socket to read data from </td></tr>
    <tr><td class="paramname">packet</td><td>Received packet metadata and payload. src and dst should be preset.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes received on success, or a value less than zero on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00923">923</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a9e9bc78d20872c6ea9cb8dddfcea45ad" name="a9e9bc78d20872c6ea9cb8dddfcea45ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e9bc78d20872c6ea9cb8dddfcea45ad">&#9670;&#160;</a></span>coap_network_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_network_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00758">758</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a4bc4949c9ad150282ec082c99510046b" name="a4bc4949c9ad150282ec082c99510046b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4bc4949c9ad150282ec082c99510046b">&#9670;&#160;</a></span>coap_packet_get_memmapped()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_packet_get_memmapped </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Given a packet, set msg and msg_len to an address and length of the packet's data in memory. </p>

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00912">912</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="af218007b0248f28b60cd0420d466c1a2" name="af218007b0248f28b60cd0420d466c1a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af218007b0248f28b60cd0420d466c1a2">&#9670;&#160;</a></span>coap_packet_set_addr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_packet_set_addr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00917">917</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a75a7c93e10ca7858449ba304aad4ea37" name="a75a7c93e10ca7858449ba304aad4ea37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75a7c93e10ca7858449ba304aad4ea37">&#9670;&#160;</a></span>coap_run_once()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_run_once </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l01285">1285</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="aac7a863c20dfbbabaa56cddd2c4109f9" name="aac7a863c20dfbbabaa56cddd2c4109f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac7a863c20dfbbabaa56cddd2c4109f9">&#9670;&#160;</a></span>coap_socket_accept_tcp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_accept_tcp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>new_client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>remote_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00490">490</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a1c01bf1b3043f11f948e4f3aff1b7823" name="a1c01bf1b3043f11f948e4f3aff1b7823"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c01bf1b3043f11f948e4f3aff1b7823">&#9670;&#160;</a></span>coap_socket_bind_tcp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_bind_tcp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>listen_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>bound_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00413">413</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a9d1deb43ee288c60730c3c8c5df8ec73" name="a9d1deb43ee288c60730c3c8c5df8ec73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d1deb43ee288c60730c3c8c5df8ec73">&#9670;&#160;</a></span>coap_socket_bind_udp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_bind_udp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>listen_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>bound_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00192">192</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a2de382e7795c908d1a376da8c338386d" name="a2de382e7795c908d1a376da8c338386d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2de382e7795c908d1a376da8c338386d">&#9670;&#160;</a></span>coap_socket_close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_socket_close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00626">626</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a85ec542c39fda4a6a5346c7801bf0ecd" name="a85ec542c39fda4a6a5346c7801bf0ecd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85ec542c39fda4a6a5346c7801bf0ecd">&#9670;&#160;</a></span>coap_socket_connect_tcp1()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_connect_tcp1 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_if</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>default_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>remote_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00268">268</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="ae591a90d6202a1b7f82b1aa688614520" name="ae591a90d6202a1b7f82b1aa688614520"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae591a90d6202a1b7f82b1aa688614520">&#9670;&#160;</a></span>coap_socket_connect_tcp2()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_connect_tcp2 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>remote_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00373">373</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a1086276cc42228e6b0b1c72b4f72fa84" name="a1086276cc42228e6b0b1c72b4f72fa84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1086276cc42228e6b0b1c72b4f72fa84">&#9670;&#160;</a></span>coap_socket_connect_udp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_socket_connect_udp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_if</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>server</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>default_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>local_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>remote_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00527">527</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="ae0cc13e29656551862a46150320f9390" name="ae0cc13e29656551862a46150320f9390"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0cc13e29656551862a46150320f9390">&#9670;&#160;</a></span>coap_socket_format_errno()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const char * coap_socket_format_errno </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l01385">1385</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a2bbd598665f98a1e2f899b475f01618b" name="a2bbd598665f98a1e2f899b475f01618b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bbd598665f98a1e2f899b475f01618b">&#9670;&#160;</a></span>coap_socket_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_socket_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00665">665</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a3728d8a61188dd4b3afd1aff807109f7" name="a3728d8a61188dd4b3afd1aff807109f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3728d8a61188dd4b3afd1aff807109f7">&#9670;&#160;</a></span>coap_socket_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_socket_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l01396">1396</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a3d4397c1a2ce78e64c19fdcd25256737" name="a3d4397c1a2ce78e64c19fdcd25256737"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d4397c1a2ce78e64c19fdcd25256737">&#9670;&#160;</a></span>coap_socket_strerror()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * coap_socket_strerror </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l01390">1390</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="a53d8fd138fc5bf331c2bf71d72ac4848" name="a53d8fd138fc5bf331c2bf71d72ac4848"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53d8fd138fc5bf331c2bf71d72ac4848">&#9670;&#160;</a></span>coap_socket_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_socket_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l00635">635</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
<a id="aaac86ac50793f309678e4951ecf8863f" name="aaac86ac50793f309678e4951ecf8863f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaac86ac50793f309678e4951ecf8863f">&#9670;&#160;</a></span>coap_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int coap_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__socket__t.html">coap_socket_t</a> *&#160;</td>
          <td class="paramname"><em>sockets</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_sockets</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>num_sockets</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For applications with their own message loop, send all pending retransmits and return the list of sockets with events to wait for and the next timeout The application should call coap_read, then coap_write again when any condition below is true: </p>
<ul>
<li>data is available on any of the sockets with the COAP_SOCKET_WANT_READ</li>
<li>an incoming connection is pending in the listen queue and the COAP_SOCKET_WANT_ACCEPT flag is set</li>
<li>at least some data can be written without blocking on any of the sockets with the COAP_SOCKET_WANT_WRITE flag set</li>
<li>a connection event occured (success or failure) and the COAP_SOCKET_WANT_CONNECT flag is set</li>
<li>the timeout has expired Before calling coap_read or coap_write again, the application should position COAP_SOCKET_CAN_READ and COAP_SOCKET_CAN_WRITE flags as applicable.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The CoAP context </td></tr>
    <tr><td class="paramname">sockets</td><td>array of socket descriptors, filled on output </td></tr>
    <tr><td class="paramname">max_sockets</td><td>size of socket array. </td></tr>
    <tr><td class="paramname">num_sockets</td><td>pointer to the number of valid entries in the socket arrays on output </td></tr>
    <tr><td class="paramname">now</td><td>Current time.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>timeout as maxmimum number of milliseconds that the application should wait for network events or 0 if the application should wait forever. </dd></dl>

<p class="definition">Definition at line <a class="el" href="coap__io_8c_source.html#l01117">1117</a> of file <a class="el" href="coap__io_8c_source.html">coap_io.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="coap__io_8c.html">coap_io.c</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
